package co.fitstart.coach.entity.security;

import com.demo2do.core.utils.Alias;

/**
 * 
 * @author downpour
 */
@Alias("authority")
public enum Authority {
    
    ROLE_COACH("coach", "教练");
    
    private String alias;
    
    private String description;
    
    /**
     * 
     * @param alias
     * @param description
     */
    private Authority(String alias, String description) {
        this.alias = alias;
        this.description = description;
    }
    
    /**
     * 
     * @param alias
     * @return
     */
    public static Authority aliasOf(String alias) {
        for (Authority authority : Authority.values()) {
            if (authority.getAlias().equalsIgnoreCase(alias)) {
                return authority;
            }
        }
        return null;
    }
    
    /**
     * @return the alias
     */
    public String getAlias() {
        return alias;
    }
    
    /**
     * @return the description
     */
    public String getDescription() {
        return description;
    }
}
